package effect.character.single;

import character.MyCharacter;
import modifier.character.CharacterModifierActionSpeed;

public abstract class SingleCharacterEffectFactory {
    
    public static SingleCharacterEffect getSingleCharacterEffect(MyCharacter owner, SingleCharacterEffectEnum singleCharacterEffectEnum) {
        SingleCharacterEffect singleCharacterEffect = new SingleCharacterEffect(owner);
        populateSingleCharacterEffect(singleCharacterEffect, singleCharacterEffectEnum);
        switch(singleCharacterEffectEnum) {
            case HEAL:
                break;
            case HASTE:
                singleCharacterEffect.addCharacterModifier(new CharacterModifierActionSpeed(owner, singleCharacterEffectEnum.getBaseEffectAmount(), singleCharacterEffectEnum.getBaseDuration()));
                break;
        }
        return singleCharacterEffect;
    }
    
    protected static void populateSingleCharacterEffect(SingleCharacterEffect singleCharacterEffect, SingleCharacterEffectEnum singleCharacterEffectEnum) {
	singleCharacterEffect.setEffectName(singleCharacterEffectEnum.getEffectName());
        singleCharacterEffect.setEffectType(singleCharacterEffectEnum.getEffectType());
	singleCharacterEffect.setBaseSpeed(singleCharacterEffectEnum.getBaseSpeed());
	singleCharacterEffect.setRangePattern(singleCharacterEffectEnum.getRangePattern());
	singleCharacterEffect.setRangeSize(singleCharacterEffectEnum.getRangeSize());
        singleCharacterEffect.setBaseEffectAmount(singleCharacterEffectEnum.getBaseEffectAmount());
        singleCharacterEffect.setBaseDuration(singleCharacterEffectEnum.getBaseDuration());
    }
}
